Skip to content

fix: harden RBAC access controls - #363

Merged
cebarks merged 1 commit into
mainfrom
security-fixes
Jul 30, 2026
Merged

fix: harden RBAC access controls#363
cebarks merged 1 commit into
mainfrom
security-fixes

Conversation

@cebarks

@cebarks cebarks commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Mod group permission fix: groups_partial, new_group_card, save_groups used Permission::ModsInstall instead of Permission::ConvoyManage — privilege downgrade allowing any mod installer to manage convoy groups
  • Profile/raid access control: Added ownership checks to all profile and per-user raid handlers — users can now only view their own data unless they have UsersManage permission. Server-wide stats/leaderboard pages remain accessible to all authenticated users (by design).
  • Built-in role sync on upgrade: sync_builtin_role_permissions now covers the moderator role, ensuring permissions added in later migrations (items.give, mods.config_edit, notes.edit) are granted on upgrade

Test plan

  • All 920 existing tests pass
  • Clippy clean with -D warnings
  • New tests: require_self_or_admin_allows_own_data, require_self_or_admin_allows_users_manage
  • New tests: sync_adds_new_moderator_permissions
  • Existing moderator_permissions test tightened to assert exact permission set
  • Manual: verify player can view own profile but not another user's
  • Manual: verify admin can view any profile

Implemented with the help of Claude Code

Three security fixes:

1. Mod group handlers (groups_partial, new_group_card, save_groups) used
   Permission::ModsInstall instead of Permission::ConvoyManage — any user
   with mod install rights could manage convoy groups.

2. Profile and raid detail handlers had no ownership checks — any
   authenticated user could view any other user's profile, stash, quests,
   traders, hideout, and raid history. Now restricted to own data unless
   the user has UsersManage permission.

3. sync_builtin_role_permissions only synced admin role on upgrade,
   leaving moderator without permissions added in later migrations
   (items.give, mods.config_edit, notes.edit). Extended to sync moderator
   with its expected permission set.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cebarks
cebarks merged commit 53317cd into main Jul 30, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant